package dfbz.demo01;

import java.util.Scanner;

public class demo01 {
    public static void main(String[] args) {
        int small = 0;
        int big = 0;
        int num = 0;
        int at = 0;
        System.out.println("请输入一段数据:");
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        for (int i = 0; i < str.length(); i++) {
            //将传入的数据进行转换
            char c = str.charAt(i);
            if ((c >= 'A' && c <= 'Z')) {
                big++;
            } else if (c >= 'a' && c <= 'z') {
                small++;
            } else if (c >= '0' && c <= '9') {
                num++;
            } else {
                at++;
            }
        }
        System.out.println("大写字符有： " + big);
        System.out.println("小写字符有： " + small);
        System.out.println("数字字符有： " + num);
        System.out.println("非法字符有： " + at);
    }
}
